<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <style>
        
        :root{
            font-size: 18px;
        }

        body {
            font-size: 20px;
        }

        .box{
            /* 
                em 相对font-size，默认 1em = 16px
                rem 相对于 root 节点的font-size
             */
            width: 10rem;
            height: 10rem;
            background-color: aquamarine;
        }
    </style>
</head>
<body>

    <div class="box">
        abc
    </div>
    
</body>
</html>